package chain.example.delivery.chain;


import chain.example.delivery.DeliveryState;
import chain.example.delivery.decorate.NoneInfo;
import chain.example.delivery.decorate.StateInfo;

public class NotPayChain implements Delivery {


    @Override
    public StateInfo doDelivery(int state, DeliveryChain deliveryChain) {
        if (state == DeliveryState.NOT_PAY.getState() || !DeliveryState.containsState(state)) {
            return new NoneInfo();
        }

        return deliveryChain.doChain(state);
    }

}
